# coding: utf-8
""" 运行文件，尽量简洁 """
from base import app, register_blueprints
# from module.lenovo import *
from plugin import Mylogger
from config import Config
import nb_log_config
from module.huada import *


@app.route('/')
def home():
    return 'welcome to saftop api module home page, please visit /docs/api to see api docs'

if __name__ == '__main__':
    Mylogger.info('''
    ====================================================================================================
                   __ _                             _        _             _   
                  / _| |                           (_)      | |           | |  
         ___  __ _| |_| |_ ___  _ __     __ _ _ __  _    ___| |_ __ _ _ __| |_ 
        / __|/ _` |  _| __/ _ \| '_ \   / _` | '_ \| |  / __| __/ _` | '__| __|
        \__ \ (_| | | | || (_) | |_) | | (_| | |_) | |  \__ \ || (_| | |  | |_ 
        |___/\__,_|_|  \__\___/| .__/   \__,_| .__/|_|  |___/\__\__,_|_|   \__|
                                | |           | |                              
                                |_|           |_|                              
    ====================================================================================================
    ''')
    # 这一段写到各module的__init__.py中，此处作为示例
    # app.config['BluePrints'] = [Panaroma, BuildDevice, Security, InfoDevice, Comm]  # 所有蓝图放到这里面来
    # app.config['API_DOC_MEMBER'] = [Panaroma, BuildDevice, Security, InfoDevice, Comm]  # 所有希望生成接口文档得蓝图放到这里来
    # app.config['API_DOC_TITLE'] = ["2. 外观全景", "3. 楼宇设施", "4. 综合安防", "5. 信息设施", "1. 通用接口"]
    register_blueprints()
    app.run(host=Config.module_config.host, port=Config.module_config.port)